<!-- 设备缺陷记录 sbqxjlList.jsp -->
<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script language="javascript" src="<%=contextPath%>/js/sorttable.js"type=""></script>
		<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/css/sorttable.css">
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/jquery.form.js"></script>
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				        },'-', 
				       
				        {
				            text: '清空',
				            icon:"<%=contextPath%>/images/clear.png",
				            handler:resetForm
				        },'-',
				        {
				            text: '取消',
				            icon:"<%=contextPath%>/images/delete.gif",
				            handler:deleteIt,
				            hidden:<%= "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        }, /**'-', 
				      	
				       {
				        	text: '检出',
				        	icon:"<%=contextPath%>/images/delete.gif",
				        	handler:toCheckOut
				        },*/'->',
				        {
				            text: '查询条件',
				            icon:"<%=contextPath%>/images/down_bottom.gif",
				            handler:displayquerydiv
				        }
				        
			    	]
			    });
			});
		</script>
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		
		<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
			<s:hidden name="searchBean.displayFlag" />		
			<s:hidden name="searchBean.con1" />
			<s:hidden name="searchBean.con5" />
			<s:hidden name="searchBean.con6" />
			<table width="100%" id="contab">
				<tbody id="querydiv">
				<tr>
					<th>
						缺陷日期：
					</th>
					<td>
						<input type="text" size="12" readonly="true" name="searchBean.con2"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" id="searchBean.con2" value="${searchBean.con2}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
						&nbsp;
						~
						&nbsp;
						<input type="text" size="12" readonly="true" name="searchBean.con3"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" id="searchBean.con3" value="${searchBean.con3}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<th>
						变电站：
					</th>
					<td>
						<input type="text" readonly="true" name="searchBean.con4" size="50" id="searchBean.con4" value="${searchBean.con4}"/>
						<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="选择变电站" 
						onClick="javascript:getBdz('searchBean.con5','searchBean.con4','searchBean.con6')" />
					</td>
				</tr>
				<tr>
					<th>
						缺陷类别：
					</th>
					<td>
						<s:select list="qxlbList" emptyOption="true" onchange="javascript:cmt()" name="searchBean.con7" width="300" listKey="itemId" listValue="itemName"/>
					</td>
					<th></th>
					<td></td>
				</tr>
				</tbody>
			</table>
			
			<hr>
			<table width="100%" id="listtab">
			<thead>
				<tr>
					<td  class="DataTable_Title"  width="25">
						<input name="chkAll" type="checkbox" id="chkAll"
							onclick="javascript:checkAll(this.form, 'id');" value="checkbox">
					</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="10">序号</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="70">缺陷编号</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="110">缺陷日期</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="60">变电站</td>					
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="70">缺陷类别</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="40%">缺陷内容</td>					
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="40">缺陷照片</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="70">消缺班组</td>
					<td class="DataTable_Title" style="font-size:12px;font-weight:bold;" width="120">消缺时间</td>
				</tr>
				</thead>
				<c:forEach items="${list}" var="detail" varStatus="status">
						<c:if test="${searchBean.con15 == detail.id}">
						<tr  ondblclick="javascript:toDetail('<c:out value="${detail.id}"/>')" style="background-color:yellow">
					</c:if>
					<c:if test="${searchBean.con15 != detail.id}">
						<tr  ondblclick="javascript:toDetail('<c:out value="${detail.id}"/>')">
					</c:if>
						<td width="25">
							<input type="checkbox" name="id" value="${detail.id}"/>
						</td>
						<td width="5"> 
						<a href="#" onClick="javascript:toDetail('<c:out value="${detail.id}"/>')" >${status.index+1}
						</a>
					 	</td>
						<td width="75">
							<c:out value="${detail.serialno}"/>
						</td>
						<td width="110" >
						${detail.reporttime}
					
						</td>
						<td width="60">&nbsp;<c:out value="${detail.bdzname}"/></td>
										
						<td width="40">
							<c:choose>
								<c:when test="${detail.category == '0'}">紧急</c:when>
								<c:when test="${detail.category == '1'}">重大</c:when>
							</c:choose>
						</td>
						<td width="40%" style="text-align: left">&nbsp;<c:out value="${detail.content}"/></td>
						<td width="40">
						${detail.filecount}张
						</td>
						<td style="text-align: left" nowrap="nowrap">
							<c:out value="${detail.xqbzname}"/>
						</td>
						<td width="120">&nbsp;<c:out value="${detail.resolvetime}"/></td>
					</tr>
				</c:forEach>
				
				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="10" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
			</table>
			<table width="100%" id="tablestyle2">
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>${pageDown}</td>
				</tr>
			</table>
		</form>
		<iframe id="ifrDownLoad" style="display:none" src=""></iframe>	
		</div>
	</body>
</html>
<script type="text/javascript">
	var st = new SortableTable(document.getElementById("listtab"),["None","None","String","String","String","String","None", "String","String","None"]);
</script>
<script language="javascript">

			// 查询
			function cmt(){
				document.frmM.action = "<%=contextPath%>/ddqxList!getList.do?page=1&c=c&searchBean.con15=";
				document.frmM.submit();
			}

			// 新建修改进入详细页面
			function toDetail(id){
				document.frmM.action = "<%=contextPath%>/sbqxjl!initDetail.do?id=" + id;
				uncheck("id");
				document.frmM.submit();
			}

			// 取消从调度过来的缺陷
			function deleteIt()
			{   var ids;
				if(!isChecked("id")) {
		 			alert("请选择要取消的记录");
		 			return false;
		 		}
		    	if(confirm("确定要取消选中的记录吗？")) {
		    	   ids = getCheckValueMany("id");
		        	document.frmM.action = "<%=contextPath%>/ddqx!saveFlag.do?conditionid=" + ids;
					document.frmM.submit();//alert(ids);
		    	}
			}
			
			//检出
			function toCheckOut()
			{
				var ids;
				if(!isChecked("id")){
					alert("请选择要检出的记录");
					return false;
				}
		    	if(confirm("确定要检出选中的记录吗？")) {
		    		ids = getCheckValueMany("id");
		        	document.frmM.action = "<%=contextPath%>/ddqx!checkOut.do?conditionid=" + ids;
					document.frmM.submit();
		    	}
			}
			
		</script>